package org.boot.ssm.wxshop.web.controller;

import org.boot.ssm.wxshop.domain.Collections;
import org.boot.ssm.wxshop.domain.Comment;
import org.boot.ssm.wxshop.service.CommentService;
import org.boot.ssm.wxshop.web.common.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @program: wxshop
 * @description: 评论控制器
 * @author: 刘涛
 * @create: 2018-03-23 21:43
 **/

@RequestMapping(value = "/comment")
@Controller
public class CommentController {
    @Autowired
    private CommentService commentService;

    /**
     * 获取商品评论集合
     *
     * @param goodsId
     * @return Map<String   ,   Object>
     */
    @RequestMapping(value = "/frontstage/listCollection")
    @ResponseBody
    public JsonResult listCollection(Integer goodsId) {
        return commentService.queryCommentAndUserNameListByGoodsId(goodsId);
    }
}
